//
//  DamageReportViewController.h
//  Project6
//
//  Created by ToanDK on 11/14/12.
//  Copyright (c) 2012 DungNP. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface DamageReportViewController : UIViewController<UITableViewDataSource,UITableViewDelegate,UIPickerViewDataSource,UIPickerViewDelegate,UIScrollViewDelegate, UIActionSheetDelegate,UITextFieldDelegate,UINavigationControllerDelegate,UITextViewDelegate,UIImagePickerControllerDelegate>
{
    IBOutlet UITableView *tblDamageReportTable;

    NSMutableArray * headerSectionIndexs;
    NSMutableArray * contentRows; // contain all row content
    
    NSMutableArray * DamageItems; // combobox Damage items
    NSMutableArray * CauseItems; // combobox Cause items
    NSMutableArray * RatingItems; // rating items
    NSString *currRating; // current rating
    
    int mode; // mode to display UIPickerView
    
    IBOutlet UIView * view1; // contains picker
    IBOutlet UIPickerView * picker; // damage type
    IBOutlet UIPickerView * picker2; // cause
    IBOutlet UIPickerView * picker3; // rating
    
    NSArray *sectionNames;
    NSArray *heighOfRowOnSections;
    // dynamic textfileds
    UITextField * tfLength;
    UITextField * tfWidth;
    UITextField * tfArea;
    UITextField * tfDepth;
    UITextField * tfDistance;
    UISegmentedControl * segmentSurface;
    UITextView * tvNotes;
    NSString * currNotes;
    
    NSMutableDictionary * activeTextFiledInfo;
    int currentSurfaceSelectedIndex; // retain selected index of suface segment
    float currentDistanceValue; // retain current distance value of slider distance
    
    BOOL tableISRESIZED;
    BOOL isSaved; // check is saved
    NSMutableArray * savedDamageRecords; // contains saved damage report
    int currentSaveSection; //use for update save section when reload table
    int indexOfFirstSaveSection;
    
    int submitTimes; // submit multi rows
    
    // Store base64 string of images take by camera or load from library
    NSMutableArray *base64Photos;
}

@property (strong,nonatomic) NSMutableDictionary * ReportDictInfo;
@property (strong, nonatomic) NSString * distanceMaxLength;
@property (strong,nonatomic) NSMutableDictionary * SuspendDicInfo; // go from suspend report
@property (strong,nonatomic) NSMutableArray * suspendedDamageRecords; // contains suspended damage records

@end
